package kaproject

import "yundian/internel/pkg/dingo"

// --------------------------- 设置默认初始值 ------------------------- //

type KaProjectAttr func(model *KaProjectModel)

type KaProjectAttrs []KaProjectAttr

func (attrFunc KaProjectAttrs) Apply(m *KaProjectModel) {
	for _, f := range attrFunc {
		f(m)
	}
}

func WithID(id int) KaProjectAttr {
	return func(model *KaProjectModel) { model.Id = id }
}

func WithKaLabel(kaLabel string) KaProjectAttr {
	return func(model *KaProjectModel) { model.KaLabel = kaLabel }
}

func WithKaName(kaName string) KaProjectAttr {
	return func(model *KaProjectModel) { model.KaName = kaName }
}

func WithKaDesc(kaDesc string) KaProjectAttr {
	return func(model *KaProjectModel) { model.KaDesc = kaDesc }
}

func WithStatusc(status uint8) KaProjectAttr {
	return func(model *KaProjectModel) { model.Status = status }
}

func WithCreateAt(createAt dingo.Time) KaProjectAttr {
	return func(model *KaProjectModel) { model.CreateAt = createAt }
}

func WithUpdateAt(updateAt dingo.Time) KaProjectAttr {
	return func(model *KaProjectModel) { model.UpdateAt = updateAt }
}

func WithCouponId(couponId int) KaProjectAttr {
	return func(model *KaProjectModel) { model.CouponId = couponId }
}

func WithMembersUrl(membersUrl string) KaProjectAttr {
	return func(model *KaProjectModel) { model.MembersUrl = membersUrl }
}

func WithMembersTestUrl(membersTestUrl string) KaProjectAttr {
	return func(model *KaProjectModel) { model.MembersTestUrl = membersTestUrl }
}

func WithAppid(appid string) KaProjectAttr {
	return func(model *KaProjectModel) { model.Appid = appid }
}

func WithAppSecret(appSecret string) KaProjectAttr {
	return func(model *KaProjectModel) { model.AppSecret = appSecret }
}

func WithIsToken(isToken uint8) KaProjectAttr {
	return func(model *KaProjectModel) { model.IsToken = isToken }
}

func WithCode(code string) KaProjectAttr {
	return func(model *KaProjectModel) { model.Code = code }
}
